package br.com.kitnet.sample.injecaodependencia;

import junit.framework.TestCase;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Teste extends TestCase {

	public Teste() {
		super();
	}

	public Teste(String name) {
		super(name);
	}

	public void tesInjecaoDependencia() {
		ApplicationContext ctx = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
		Competidor competidor1 = (Competidor) ctx.getBean("jose");
		competidor1.apresentar();
		
		System.out.println("proximo competidor... ");
		
		Competidor competidor2 = (Competidor) ctx.getBean("carlos");
		competidor2.apresentar();
	}
}
